#
# OpenSSL/crypto/chacha/Makefile
#

DIR=	chacha
TOP=	../..
CC=	cc
CPP=    $(CC) -E
INCLUDES=
CFLAG=-g
AR=		ar r

CHACHA_ENC=chacha_enc.o

CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG) $(SHARED_CFLAG)
AFLAGS= $(ASFLAGS)

GENERAL=Makefile

LIB=$(TOP)/libcrypto.a
LIBSRC=chacha_enc.c
LIBOBJ=$(CHACHA_ENC)

SRC= $(LIBSRC)

ALL=    $(GENERAL) $(SRC) $(HEADER)

top:
	(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)

all:	lib

lib:	$(LIBOBJ)
	$(AR) $(LIB) $(LIBOBJ)
	$(RANLIB) $(LIB) || echo Never mind.
	@touch lib

chacha-x86.s:		asm/chacha-x86.pl
	$(PERL) asm/chacha-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
chacha-x86_64.s:	asm/chacha-x86_64.pl
	$(PERL) asm/chacha-x86_64.pl $(PERLASM_SCHEME) $@
chacha-ppc.s:	asm/chacha-ppc.pl
	$(PERL) asm/chacha-ppc.pl $(PERLASM_SCHEME) $@

chacha-%.S:	asm/chacha-%.pl;	$(PERL) $< $(PERLASM_SCHEME) $@

chacha-armv4.o:	chacha-armv4.S
chacha-armv8.o:	chacha-armv8.S

depend:
	$(TOP)/util/domd $(CFLAG) $(INCLUDES) -- $(PROGS) $(LIBSRC)

clean:
	rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff

# DO NOT DELETE THIS LINE -- make depend depends on it.
